package com.caigou.modules.personal.network.api

import com.caigou.comm.base.bean.HttpResult
import com.caigou.comm.base.bean.UserBean
import com.caigou.modules.personal.bean.*
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * @author #Suyghur.
 * Created on 2021/09/18
 */
interface HttpPersonalApiService {

    @POST("/api/password/reset")
    fun modifyPwd(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/user/update/nick/name")
    fun modifyNickName(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<UserBean>>

    @POST("/api/user/upload/headimg")
    fun uploadAvatar(@Body body: RequestBody): Flow<HttpResult<String>>

    @POST("/api/user/update/real/name")
    fun modifyRealName(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<UserBean>>

    @POST("/api/user/update/signature")
    fun modifySignature(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<UserBean>>

    @GET("/api/level/growth/value/detail")
    fun getGrowthValueList(@Query("page") page: Int, @Query("limit") limit: Int, @Query("userId") userId: String): Flow<HttpResult<GrowthVoBean>>

    @GET("/api/message/board/reply/list")
    fun getBoardList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("boardUserId") boardUserId: String,
        @Query("currentUserId") currentUserId: String
    ): Flow<HttpResult<BoardBean>>

    @POST("/api/message/board/add/reply")
    fun setReply(@Body body: RequestBody): Flow<HttpResult<BoardReplyBean>>

    @GET("/api/message/board/reply/detail")
    fun getBoardDetail(@Query("boardUserId") boardUserId: String, @Query("replyId") replyId: Int): Flow<HttpResult<BoardItemBean>>

    @GET("/api/user/home/page/info")
    fun getUserPageInfo(@Query("userId") userId: String, @Query("alreadyLoginUserId") currentUserId: String): Flow<HttpResult<UserPageInfoBean>>

    @GET("/api/gaxtczm/data/list")
    fun getTicketList(@Query("type") type: Int, @Query("userId") userId: String): Flow<HttpResult<PostBean>>

    @GET("/api/famous/my/dare/result/list")
    fun getFamousList(@Query("type") type: Int, @Query("userId") userId: String): Flow<HttpResult<MutableList<FamousItemBean>>>

    @GET("/api/folk/data/my/list")
    fun getInfoList(
        @Query("page") page: Int,
        @Query("limit") limit: Int,
        @Query("userId") userId: String,
        @Query("checkStatus") checkStatus: Int = 0
    ): Flow<HttpResult<InfoBean>>


}


